#include "TCP_server.hpp"

#include<memory>

// 服务端直接 ./TCP_server port 
void Usage()
{
    std::cout << "usage:\n./TCP_server port" << std::endl; 
    exit(1);
}

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        Usage();
    }

    uint16_t port = std::stoi(argv[1]);
    std::unique_ptr<Server> serv(new Server(port));

    serv->InitServer();

    serv->StartServer();

    return 0;
}